<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:choose>
	<c:when test="${user != null}">
		<c:if test="${usertype == 'Admin User'}">
			
		</c:if>
	</c:when>
	<c:otherwise>
		<jsp:forward page="login.jsp" />
	</c:otherwise>
</c:choose>

<script src="resource/js/popup/approve.js"></script>
<script src="resource/js/popup/reject.js"></script>
<script src="resource/js/jquery/dnd.js"></script>

<div id="content">

	<!--  start page-heading -->
	<div id="page-heading">
		<h1 align="center" style="font-size: 30px; font-weight: bold">Review Transaction</h1>
	</div>
	<!-- end page-heading -->

	<!--  start top-search -->
	<div id="message-area">
		<span style="color: red">${error}</span>
	</div>
	
	<table id="content-table">
		<tr>
			<th rowspan="3" class="sized"><img
				src="resource/images/shared/side_shadowleft.jpg" width="20"
				height="300" alt="" /></th>
			<th class="topleft"></th>
			<td id="tbl-border-top">&nbsp;</td>
			<th class="topright"></th>
			<th rowspan="3" class="sized"><img
				src="resource/images/shared/side_shadowright.jpg" width="20"
				height="300" alt="" /></th>
		</tr>


		<tr>
			<td id="tbl-border-left"></td>
			<td>
				<!--  start content-table-inner ...................................................................... START -->
				<div id="content-table-inner">

					<!--  start table-content  -->
					<div id="table-content">

						<form id="mainform" action="">
							<table id="product-table" class="paging">
								<thead>
									<tr>
										<th class="table-header-repeat line-left "><a>ID</a></th>
										<th class="table-header-repeat line-left minwidth-1"><a>SENDER</a></th>
										<th class="table-header-repeat line-left minwidth-1"><a>RECEIVER</a></th>
										<th class="table-header-repeat line-left minwidth-1"><a>AMOUNT</a></th>
										<th class="table-header-repeat line-left minwidth-1"><a>TYPE</a></th>
										<th class="table-header-repeat line-left minwidth-1"><a>STATE</a></th>
										<th class="table-header-repeat line-left minwidth-1"><a>REQUEST</a></th>
										<th class="table-header-repeat line-left minwidth-1"><a>SUPPORTER</a></th>
										<th class="table-header-options line-left "><a>APPROVE</a></th>
										<th class="table-header-options line-left "><a>REJECT</a></th>
									</tr>
								</thead>
								<tbody>
									<c:forEach var="transaction" items="${listTransaction}">
										<c:if test="${transaction.idTransaction != null}">
											<tr>
												<td align="center">${transaction.idTransaction}</td>
												<td align="center">${transaction.sendAccount.accountNumber}</td>
												<td align="center">${transaction.receiveAccount.accountNumber}</td>
												<td align="center">${transaction.changeAmount}</td>
												<td align="center">${transaction.transactionType}</td>
												<td align="center">${transaction.transactionStatus}</td>
												<td align="center">${transaction.beginTime}</td>
												<td align="center">${transaction.userSupport.userName}</td>
												<td align="center"><input data-approve=${transaction.idTransaction }
														type="button" class="btn_approve" value="" />
												</td>
												<td align="center"><input data-reject=${transaction.idTransaction }
														type="button" class="btn_reject" value="" />
												</td>
											</tr>
										</c:if>
									</c:forEach>
								</tbody>
							</table>
							<!--  end product-table................................... -->
						</form>
						
					</div>
					<!--  end content-table  -->



					<!--  start paging..................................................... -->

					<!--  end paging................ -->

					<div class="clear"></div>

				</div> <!--  end content-table-inner ............................................END  -->
			</td>
			<td id="tbl-border-right"></td>
		</tr>
		<tr>
			<th class="sized bottomleft"></th>
			<td id="tbl-border-bottom">&nbsp;</td>
			<th class="sized bottomright"></th>
		</tr>
	</table>
<!-- 	<div id="error"> -->
</div>
<div class="clear">&nbsp;</div>
	
<!-- --------------------------------------------------------------------------------------------- -->
<!-- -------------------------------APPROVE---------------------------------------------- -->
<div id="popup_approve" class="popup_container">
	<form id="form_approve">
		<div class="popup_title_bar">APPROVE</div>
		<div class="popup_image_approve_confirm"></div>
		<div class="popup_image_approve_stop"></div>
		<div class="popup_content">	
			<table id="table_approve">
				<tr>
					<td class="format-left">Transaction ID:</td>
					<td class="idTransaction">hello Mrs.Nam</td>
				</tr>
				<tr>
					<td class="format-left">Transaction Type:</td>
					<td class="transactionType"></td>
				</tr>			
				<tr>
					<td class="format-left">Transaction State:</td>
					<td class="transactionStatus"></td>
				</tr>
				<tr>
					<td class="format-left">Current Amount:</td>
					<td class="currentAmount"></td>
				</tr>
				<tr>
					<td class="format-left">Money Transaction:</td>
					<td class="changeAmount"></td>
				</tr>
				<tr>
					<td class="format-left">Request Time:</td>
					<td id="beginTimeApr" style="line-height: 15px;"></td>
				</tr>			
				<tr>
					<td class="format-left">User Support:</td>
					<td class="userSupport"></td>
				</tr>
				<tr>
					<td class="format-left">Comment:</td>
					<td><textarea rows="4" cols=25% maxlength="30" name="comment"></textarea>
					</td>
				</tr>
			</table>
		</div>
		<div class="popup_transaction_response">
			<input type="hidden" name="transactionId" id="idTransactionApr">
			<p class="message"></p>
			<p class="error"></p>
			<p class="validation"></p>
		</div>
		<div class="popup_bottom_bar">
			<input class="popup_button_left" type="button" value="confirm" id="btn_approve_complete"/>
			<input class="popup_button_right" type="button" value="cancel" id="btn_approve_cancel"/>
		</div>
	</form>
</div>

<!-- -------------------------------APPROVE COMPLETE---------------------------------------------- -->
<div id="popup_approve_complete" class="popup_container">
	<form id="form_approve">
		<div class="popup_title_bar">APPROVE</div>
		<div class="popup_image_approve_complete"></div>
		<div class="popup_content">	
			<p class="message"></p>
			<p class="error"></p>
			<p class="validation"></p>
		</div>
		<div class="popup_bottom_bar">
			<input class="popup_button_center" type="submit" value="Close" id="btn_approve_close"/>
		</div>
	</form>
</div>
<!-- --------------------------------------------------------------------------------------------- -->
<!-- -------------------------------END. APPROVE---------------------------------------------- -->



<!-- --------------------------------------------------------------------------------------------- -->
<!-- -------------------------------REJECT---------------------------------------------- -->
<div id="popup_reject" class="popup_container">
	<form id="form_reject">
		<div class="popup_title_bar">REJECT</div>
		<div class="popup_image_reject_confirm"></div>
		<div class="popup_content">	
			<table id="table_reject">
				<tr>
					<td class="format-left">Transaction ID:</td>
					<td class="idTransaction">hello Mrs.Nam</td>
				</tr>
				<tr>
					<td class="format-left">Transaction Type:</td>
					<td class="transactionType"></td>
				</tr>			
				<tr>
					<td class="format-left">Transaction State:</td>
					<td class="transactionStatus"></td>
				</tr>
				<tr>
					<td class="format-left">Money Transaction:</td>
					<td class="changeAmount"></td>
				</tr>
				<tr>
					<td class="format-left">Request Time:</td>
					<td id="beginTimeReject" style="line-height: 15px;"></td>
				</tr>			
				<tr>
					<td class="format-left">User Support:</td>
					<td class="userSupport"></td>
				</tr>
				<tr>
					<td class="format-left">Comment:</td>
					<td><textarea rows="4" cols=25% maxlength="30" name="comment"></textarea>
					</td>
				</tr>
			</table>
		</div>
		<div class="popup_transaction_response">
			<input type="hidden" name="transactionId" id="idTransactionReject">
			<p class="message"></p>
			<p class="error"></p>
			<p class="validation"></p>
		</div>
		<div class="popup_bottom_bar">
			<input class="popup_button_left" type="button" value="confirm" id="btn_reject_complete"/>
			<input class="popup_button_right" type="button" value="cancel" id="btn_reject_cancel"/>
		</div>
	</form>
</div>

<!-- -------------------------------REJECT COMPLETE---------------------------------------------- -->
<div id="popup_reject_complete" class="popup_container">
	<form id="form_reject">
		<div class="popup_title_bar">REJECT</div>
		<div class="popup_image_reject_complete"></div>
		<div class="popup_content">	
			<p class="message"></p>
			<p class="error"></p>
			<p class="validation"></p>
			<p class="test_error"></p>
		</div>
		<div class="popup_bottom_bar">
			<input class="popup_button_center" type="submit" value="Close" id="btn_reject_close"/>
		</div>
	</form>
</div>
<!-- --------------------------------------------------------------------------------------------- -->
<!-- -------------------------------END. REJECT---------------------------------------------- -->



